@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

// Mobile mixin
@mixin for-size($range) {
    $phone-upper-boundary: 900px;
    $tablet-portrait-upper-boundary: 1100px;
    $tablet-landscape-upper-boundary: 1200px;
    $desktop-upper-boundary: 1800px;

    @if $range == phone-only {
        @media (max-width: #{$phone-upper-boundary - 1}) { @content; }
    } @else if $range == tablet-portrait-up {
        @media (min-width: $phone-upper-boundary) { @content; }
    } @else if $range == tablet-landscape-up {
        @media (min-width: $tablet-portrait-upper-boundary) { @content; }
    } @else if $range == desktop-up {
        @media (min-width: $tablet-landscape-upper-boundary) { @content; }
    } @else if $range == big-desktop-up {
        @media (min-width: $desktop-upper-boundary) { @content; }
    }
}

// Use it like this:
// @include for-size(phone-only) {
//   margin: 30px;
// }

//
// Globals
//
body {
  background-color: $darker;
  display: inline;
}

div, p, td, input, p {
  font-family: 'Open Sans', sans-serif !important;
}

h1,
h2 {
  color: $title;
}

p {
  color: $text;
}

a, a:link, a:active, a:visited {
  color: #828282;
  text-decoration: none;
}

a:hover {
  color: darken($title, 20%);
  transition: 0.4s all;
}

input {
  padding: 10px;
  border: none !important;
  background: $light !important;
  color: $text !important;
  font-size: 1em !important;
  outline: none;
  margin: 0px 5px !important;
  border-radius: 0 !important;

  @if ($theme == "light") {
    border-radius: 3px !important;
  }
}

input.button,
input.submit,
input[type="submit"] {
  border-left: 7px solid $accent !important;
  background: $light !important;
  font-weight: 600;
  transition: 0.3s all !important;
  cursor: pointer;

  @if ($theme == "light") {
    background: $accent !important;
    border-left: none !important;
    color: white !important;
    font-weight: 700;
  }
}

// Need to fix this, because I've had to copy this down lower to make it apply to the add URL button
input.button:hover,
input.submit:hover,
input[type="submit"]:hover {
  background: darken($accent, 15%) !important;

  @if ($theme == "light") {
    background: darken($accent, 15%) !important;
  }
}

input[type="button"]:disabled,
input[type="submit"]:disabled {
  cursor: not-allowed;
}

input.text,
input[type="text"] {
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: 0.4s all;
}

@if ($theme != "light") {
  input.text:active,
  input.text:focus {
      border: 1px solid $accent !important;
  }
}

select {
	width: 150px;
	padding: 5px 35px 5px 10px;
	// font-size: 0.9em;
	border: none;
	border-radius: 0;
	height: 26px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	color: $text;
	background: url() 96% / 15% no-repeat $light;
	margin: 5px 10px;
  transition: 0.4s all;
  outline: none;
}

select:hover {
  	background: url() 96% / 15% no-repeat $light;
}

#javascript_error {
  background: red;
  color: white;
  padding: 20px;
  margin-top: 10px;
}

// End Globals

//
// Notification Bar
//
.jquery-notify-bar {
  color: #fff;
  text-shadow: none;
  border: none;
  opacity: 1;
  box-shadow: none;
  font-size: 1.1em;
  font-weight: 500;
  position: static;
  margin-top: 30px;
  margin-bottom: -45px;
  padding: 10px;

  a, a:link, a:active, a:visited {
    color: white;
  }
}

.jquery-notify-bar.error,
.jquery-notify-bar.fail {
  background-color: #FF9800;
  color: white;
}

.jquery-notify-bar.success {
  color: white;
  background-color: #4CAF50;
}

// End Notification Bar

// 
// Login page
// 
.login {
  #wrap {
    margin: auto;
  }

  label {
    font-size: 1em;
    font-weight: 600;
  }

  .login-logo {
    width: 150px;
    margin: 30px auto;
    display: flex;
  }

  input.text {
    width: 270px !important;
  }

  input.button {
    font-weight: 600;
    padding: 10px 25px;
    margin-top: 15px !important;
    font-weight: 600;

    @if ($theme == "light") {
      background: $accent !important;
    } else {
      background: $light !important;
      border-left: 7px solid $accent !important;
    }
  }

  input.button:hover {
    background: darken($accent, 10%) !important;
  }

  .error {
    padding: 10px;
    background: $accent;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    text-align: center
  }
}

// End login page

// 
// Start Index page
//
.index {
  #add-url {
    width: 200px;
  }

  #new_url_form {
    box-sizing: border-box;
    overflow: hidden;
    // min-width: 900px;
  }

  #new_url {
    border: none;
    background: $default;
    text-align: left;

    input.button {
      margin-top: 10px !important;
    }

    div {
      background: $default;
      padding: 4px;
      padding-top: 0px;
    }
  }

  .create {
    background: $accent !important;
    width: 150px;
    font-size: 1.3em !important;
    border: none !important;
    font-weight: 700;
    text-align: center;
    margin-top: 10px !important;
    margin-left: 20px !important;
  }

  .top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 50px;

    @if ($theme == "light") {
      background: darken($accent, 10%);
    } @else {
      background: $default;
    }

    label {
      font-size: 1em;
      font-weight: 600;
      color: $text;

      @if ($theme == "light") {
        color: $default;
      }
    }

    input.text {
      width: 360px;
      padding: 4px;
      font-weight: 200;
      font-size: 1em !important;

      @if ($theme == "light") {
        background: $default !important;
      } @else {
        background: $lightest !important;
      }
    }

    .short {
      padding-left: 10px;
    }

    #add-keyword {
      width: 100px;
    }

    input.button {
      font-weight: 500;
      padding: 5px 10px;
      font-size: 1em !important;
      margin-left: 10px !important;
      background: $lightest !important;

      @if ($theme == "light") {
        background: $default !important;
        font-weight: 700;
        color: $accent !important;
      }
    }

    input.button:hover {
      background: darken($accent, 10%) !important;

      @if ($theme == "light") {
        background: darken(white, 10%) !important;
      }
    }

    #new_url_form {
      margin-left: 260px;
      padding: 12px;
    }
  }

  // Table stuff
  table.tblSorter {
    background-color: $default;
    color: $text;

    a {
      color: $text;
    }

    small a {
      color: darken(white, 50%)
    }

    thead tr .tablesorter-header {
      padding: 10px;
    }

    tfoot tr {
      background-color: $default;
    }

    thead tr th,
    tfoot tr th,
    th.header {
      background-color: transparent;
      border: none;
      /* font-size: 8pt; */
      padding: 4px;
    }

    thead tr .tablesorter-headerAsc,
    thead tr .tablesorter-headerDesc {
      background-color: $lightest !important;
    }

    tbody td {
      color: $text;
      padding: 5px;
      background-color: $light;
      vertical-align: middle;
      transition: 0.4s all;
    }

    tbody tr:hover td {
      background-color: $lightest !important;
    }

    tbody tr.normal-row td {
      background: $light;
    }

    .keyword {
      border-left: 7px solid $accent;
    }

    input.text {
      padding: 5px;
      margin: 8px 5px !important;
    }

    .navigation .nav_link a {
        background: $light;
        border: none;

        &:hover {
          background: $lightest;
        }
    }

    tr.edit-row td {
      background: $default !important;
    }

    // Icons
    $icons-list: stats, share, edit, delete;
    @each $icon in $icons-list {
      @if $icon == delete {
        td.actions .button_#{$icon} { 
          background: red url(../img/#{$icon}.png) 0px center no-repeat;
          background-size: 23px;
          background-position: center;
          border: none;
          padding: 3px;
          border-radius: 2px;

          &:hover { 
            background: darken(red, 10%) url(../img/#{$icon}.png) 0px center no-repeat;
            background-size: 23px;
            background-position: center;
          }
        }
      } @else {
        td.actions .button_#{$icon} { 
          background: $accent url(../img/#{$icon}.png) 0px center no-repeat;
          background-size: 23px;
          background-position: center;
          border: none;
          padding: 3px;
          border-radius: 2px;

          &:hover { 
            background: darken($accent, 10%) url(../img/#{$icon}.png) 0px center no-repeat;
            background-size: 23px;
            background-position: center;
          }
        }
      }
    }
  }
}

// End index page


// 
// Nav
// 
nav {
  background: $default;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  padding: 50px 30px;
  width: 200px;
  z-index: 10;

  li#admin_menu_logout_link {
    font-size: 1.3em;
  }

  ul#admin_menu li:hover {
    list-style-type: none;
    color: darken($title, 20%);
  }

  ul#admin_menu li {
    color: $title;
    padding: 5px 0;
  }

   #admin_menu_logout_link:hover {
    color: $title !important;
  }

  .admin_menu_sublevel {
    font-weight: 100;
    margin-left: -20px;
  }

  .material-icons {
    font-size: 1em;
    vertical-align: middle;
    margin-top: -1px;
  }

  ul {
    list-style-type: none;
  }
}

img.logo {
  width: 90px;
  position: fixed;
  top: 0;
  left: 0;
  background: $accent;
  padding: 9px 150px 8px 20px;
  z-index: 20;
}

.nav-open {
  color: white;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  padding: 10px 15px;
  cursor: pointer;
  display: none;

  i {
    font-size: 2em;
    line-height: 30px;
  }
}

header {
  display: none;
}

// End nav

//
// Information
// 
#wrap {
  #tabs {
    min-width: 580px;

    .tab {
      background: $light !important;
    }

    .wrap_unfloat {
      margin-bottom: -5px;
    }

    ul#headers {
      border: none;
      padding: 0px;
    }

    li {
      color: $text;
    }

    #historical_clicks li:hover {
      background: darken($default, 10%) !important;
    }

    ul#headers li a,
    #stats_lines li a {
      outline: none;
      border: none;
      border-radius: 0;
      background: $light;
      color: $text;
      padding: 10px 15px 7px 25px;

      &:hover {
        background: darken($default, 10%);
      }

      h2 {
        font-weight: 400;
        font-size: 1em;
      }

      &.selected {
        background: $lightest;
        border-bottom: 2px solid $accent;

        &:hover {
          background: darken($default, 15%);
        }
      }
    }

    #stats_lines li a {
      padding: 7px 15px;
    }

    ul.toggle_display {
      border: none;
    }

    svg {
      ellipse {
        fill: $accent;
      }
    }
  }
}

// 
// General Styles
// 

body.index #wrap {
  padding-top: 50px;
}

#wrap {
  background: none;
  margin-left: 270px;
  border: none;
  color: $text;
  max-width: 100%;
}

.notice {
  width: calc(100% - 22px);
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: $accent;
  border: 1px solid $accent;
  padding: 10px;

  p {
    color: white;
  }
}

#shareboxes {
  margin-top: -10px;
}

#sharebox {
  width: 558px;
  margin-right: 0px;
}

div.share {
  background: $default;
  border-radius: 0;
  border: none;
  padding: 0px 20px 10px;
  margin-top: 10px;

  textarea {
    background: $light;
    color: $text;
    border: none;
    padding: 3px;
    outline: none;
    margin: 1px !important;
  }

  #charcount {
    padding-left: 5px;
    color: $text;
  }

  #share_links a {
    color: $text;
  }
}

.sub_wrap,
.plugins main,
.plugin_page_sleeky_settings main,
code {
  background: $default;
  padding: 10px;
  padding: 5px 25px;
  max-width: 100%;

  span  {
    background: rgba(255, 255, 255, 0.2);
  }

  code,
  tt {
    background: rgba(0, 123, 255, 0.7);  
    
    @if ($theme == "light") {
      background: rgba(35, 185, 222, 0.5);
    }
  }

  a.bookmarklet {
    border: none;
    background: #ffffff url(/images/favicon.gif) 4px center no-repeat;
    color: #3c3c3c;
    border-radius: 1px;
    padding: 7px 7px 7px 25px;
    color: darken(white, 80%) !important;

    &:hover {
      background: #e0e0e0 url(/images/favicon.gif) 4px center no-repeat;
    }
  }

  // Table
  table.tblSorter {
    background: $default;

    a {
      color: $text;

      &:hover {
        color: darken($text, 30%);
      }
    }

    thead tr th,
    tfoot tr th,
    th.header {
      border: none;
      background-color: $light;
      padding: 10px;
    }

    tbody td {
      background: $lightest;
      color: $text;
    }
  }
}

#filter_options {
  padding: 0px 10px !important;
}

body > div > pre {
  overflow-x: scroll;
  padding-left: 290px;
}

// End General Styles


// 
// Footer
// 

#footer {
  position: fixed;
  bottom: 0;
  width: 230px;
  color: #828282;
  padding: 10px;
  text-align: left;
  z-index: 10;

  p {
  background: none;
  border: none;
  font-size: 1em;

    a {
      background: none;
      padding-left: 0;
      color: $text;

      &:hover {
        color: #828282;
      }
    }
  }
}

// End footer

// Mobile styles
@include for-size(phone-only) {
  body.index #wrap {
    padding-top: 210px;
  }
  
  body.tools #wrap,
  body.plugins #wrap,
  body.plugin_page_sleeky_settings #wrap {
    padding-top: 50px;
  }
  #wrap {
    margin-left: 0;

    main {
      overflow-x: scroll;
    }
  }

  img.logo {
    padding: 9px 100% 8px 20px;
  }

  .nav-open {
    display: block;
  }

  nav {
    height: 0;
    padding: 0;
    width: 0;

    ul#admin_menu {
      position: fixed;
      top: 0;
      left: 0;
      z-index: 9999 !important;
      width: 100%;
      height: 100%;
      padding: 50px;
      display: none;
      @if ($theme == "light") {
        background: darken($accent, 10%);
      } @else {
        background: $default;
      }

      li {
        color: white;
      }

      a, a:link, a:active, a:visited {
        color: white;
      }
    }
  }

  .index {
    .top {
      display: block;
      margin-top: 50px;
      width: 100vw;
      height: auto;

      form {
        margin-left: 0 !important;
      }

      #new_url_form {
        min-width: unset;
        height: auto;
      }

      .short {
        padding: 0;
      }

      #add-url,
      #add-keyword {
        width: calc(100% - 10px);
        margin: 10px 0px !important;
      }

      input.button {
        margin: 0 !important;
        width: 100%;
      }
    }
    
    table.tblSorter {
      min-width: 600px;

      // Icons
      $icons-list: stats, share, edit, delete;
      @each $icon in $icons-list {
        td.actions .button_#{$icon} { 
          background-size: 15px;
          margin: 3px;
        }
      }
    }
  }
  
  #copybox {
    width: 100%;
  }

  .jquery-notify-bar {
    margin-top: 210px;
    margin-bottom: -210px;
    width: calc(100vw - 20px);

    a {
      margin-left: -30px;
    }
  }

  #footer {
    display: none;
  }

  .infos #wrap {
    margin-top: 30px;
    

    #headers {
      li {
        margin: 0;
        display: inline-block;
      }
    }
  }

  .infos #tabs {
    min-width: initial;

    .tab {
      overflow: scroll;
    }

    ul#headers {
      margin: 20px 0;

      li {
        a {
          padding: 10px 5px;
        }

        h2 {
          margin: 0;
        }
      }
    }
  }

  body > div > pre {
    padding-left: 20px;
  }
}